<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待办事项管理系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            width: 95%;
            max-width: 1200px;
            min-height: 800px;
            text-align: center;
            padding: 60px 40px;
        }
        
        .logo {
            font-size: 4em;
            margin-bottom: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        h1 {
            font-size: 2.5em;
            margin-bottom: 15px;
            color: #2c3e50;
            font-weight: 300;
        }

        .subtitle {
            font-size: 1.2em;
            color: #6c757d;
            margin-bottom: 40px;
            line-height: 1.6;
        }
        
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
            margin-bottom: 40px;
        }

        .feature {
            padding: 20px;
            background: #f8f9fa;
            border-radius: 15px;
            transition: all 0.3s ease;
        }

        .feature:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .feature-icon {
            font-size: 2em;
            margin-bottom: 10px;
        }

        .feature-title {
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .feature-desc {
            font-size: 0.9em;
            color: #6c757d;
        }
        
        .start-btn {
            display: inline-block;
            padding: 18px 40px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            text-decoration: none;
            border-radius: 50px;
            font-size: 1.2em;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
        }

        .start-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
        }

        .footer {
            margin-top: 40px;
            padding-top: 30px;
            border-top: 1px solid #e9ecef;
            color: #6c757d;
            font-size: 0.9em;
        }
        
        .todo-container {
            max-width: 700px;
            margin: 0 auto;
        }
        
        .todo-input {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
        }
        
        .todo-input input {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e9ecef;
            border-radius: 25px;
            font-size: 16px;
        }
        
        .todo-input button {
            padding: 12px 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .todo-list {
            space-y: 10px;
        }
        
        .todo-item {
            background: #f8f9fa;
            padding: 15px 20px;
            border-radius: 15px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: all 0.3s ease;
            border-left: 4px solid transparent;
        }
        
        .todo-item:hover {
            transform: translateX(5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .todo-item.completed {
            opacity: 0.7;
            border-left-color: #28a745;
        }
        
        .todo-item.starred {
            border-left-color: #ffc107;
            background: #fff8e1;
        }
        
        .todo-content {
            flex: 1;
        }
        
        .todo-title {
            font-weight: 600;
            margin-bottom: 5px;
            color: #333;
        }
        
        .todo-title.completed {
            text-decoration: line-through;
            color: #6c757d;
        }
        
        .todo-desc {
            color: #6c757d;
            font-size: 14px;
        }
        
        .todo-actions {
            display: flex;
            gap: 10px;
        }
        
        .action-btn {
            padding: 6px 12px;
            border: none;
            border-radius: 15px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s ease;
        }
        
        .star-btn {
            background: #ffc107;
            color: white;
        }
        
        .complete-btn {
            background: #28a745;
            color: white;
        }
        
        .delete-btn {
            background: #dc3545;
            color: white;
        }
        
        .action-btn:hover {
            transform: scale(1.1);
        }
        
        .error {
            color: #dc3545;
            text-align: center;
            margin-top: 10px;
            padding: 10px;
            background: #f8d7da;
            border-radius: 10px;
        }
        
        .success {
            color: #155724;
            text-align: center;
            margin-top: 10px;
            padding: 10px;
            background: #d4edda;
            border-radius: 10px;
        }
        
        .loading {
            text-align: center;
            padding: 20px;
            color: #6c757d;
        }
        
        .todo-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid #e9ecef;
        }

        .todo-header h2 {
            color: #2c3e50;
            margin: 0;
        }

        .header-actions {
            display: flex;
            gap: 10px;
        }

        .chart-btn {
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .chart-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
        }

        .chart-container {
            background: white;
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            margin-bottom: 30px;
            height: 400px;
            position: relative;
        }
        
        .chart-container canvas {
            max-height: 350px !important;
            width: 100% !important;
        }

        .chart-container h3 {
             color: #2c3e50;
             margin: 0 0 20px 0;
             text-align: center;
         }

        @media (max-width: 768px) {
            .container {
                margin: 10px;
                padding: 40px 20px;
            }

            h1 {
                font-size: 2em;
            }

            .logo {
                font-size: 3em;
            }

            .features {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="logo">📝</div>
        <h1>待办事项管理系统</h1>
        <p class="subtitle">
            高效管理您的日常任务，提升工作效率<br>
            简洁易用的界面，强大的功能体验
        </p>
        
        <div class="features">
            <div class="feature">
                <div class="feature-icon">✅</div>
                <div class="feature-title">任务管理</div>
                <div class="feature-desc">轻松添加、编辑和完成任务</div>
            </div>
            <div class="feature">
                <div class="feature-icon">⭐</div>
                <div class="feature-title">重要标记</div>
                <div class="feature-desc">为重要任务添加星标</div>
            </div>
            <div class="feature">
                <div class="feature-icon">📊</div>
                <div class="feature-title">数据分析</div>
                <div class="feature-desc">可视化任务完成统计</div>
            </div>
        </div>
        
        <a href="login.html" class="start-btn">开始使用</a>
        
        <div class="footer">
            <p>© 2024 待办事项管理系统 - 让生活更有序</p>
        </div>
    </div>
    
    <script>
        // 检查是否已登录，如果已登录则直接跳转到任务页面
        const token = localStorage.getItem('token');
        const userId = localStorage.getItem('userId');
        
        if (token && userId) {
            window.location.href = 'todo.html';
        }
    </script>
</body>
</html>